/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 abstract_stationary_adv_object.h

	$Header: /heroes4/abstract_stationary_adv_object.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ABSTRACT_STATIONARY_ADV_OBJECT_H_INCLUDED )
#define ABSTRACT_STATIONARY_ADV_OBJECT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <string>

#include "abstract_adv_object.h"
#include "cached_ptr.h"
#include "copy_on_write_ptr.h"
#include "resource_cache.h"

class t_adv_object_model;
enum  t_player_color;

// ------------------------------------------------------------------------------
// Details namespace
// ------------------------------------------------------------------------------

namespace abstract_stationary_adv_object_details
{

	class t_impl;

} // Details namespace

// ------------------------------------------------------------------------------
// t_abstract_stationary_adv_object class
// ------------------------------------------------------------------------------

class t_abstract_stationary_adv_object : public virtual t_abstract_adv_object
{
public:
	// Types
	typedef t_adv_object_model						t_model;
	typedef t_resource_cache< t_adv_object_model >	t_model_cache;
	typedef t_cached_ptr< t_model >					t_model_ptr;

	// Constructors
	t_abstract_stationary_adv_object( t_abstract_stationary_adv_object const & other );
	explicit t_abstract_stationary_adv_object( std::string const & model_name );
	explicit t_abstract_stationary_adv_object( t_model_cache const& cache );
	virtual ~t_abstract_stationary_adv_object();

	// Member functions
	virtual void				accept( t_visitor & visitor );
	virtual void				accept( t_visitor & visitor ) const;
	virtual bool				animates() const;
	virtual void				draw_shadow_to(
									t_uint32				current_time, 
									t_screen_rect const &	source_rect, 
									t_abstract_bitmap16 &	dest, 
									t_screen_point const &	dest_point ) const;
	virtual void				draw_shadow_to(
									t_uint32				current_time,
									t_abstract_bitmap16 &	dest,
									t_screen_point const &	dest_point ) const;
	virtual void				draw_subimage_to(
									int						subimage_num,
									t_uint32				current_time,
									t_screen_rect const &	source_rect,
									t_abstract_bitmap16 &	dest, 
									t_screen_point const &	dest_point,
									int						alpha = 15 ) const;
	virtual void				draw_subimage_to(
									int						subimage_num,
									t_uint32				current_time, 
									t_abstract_bitmap16 &	dest, 
									t_screen_point const &	dest_point ) const;
	virtual void				draw_to(
									t_uint32				current_time,
									t_screen_rect const &	source_rect,
									t_abstract_bitmap16 &	dest, 
									t_screen_point const &	dest_point ) const;
	virtual void				draw_to(
									t_uint32				current_time,
									t_abstract_bitmap16 &	dest, 
									t_screen_point const &	dest_point ) const;
	virtual t_footprint const &	get_footprint() const;
	t_model const &				get_model() const;
	std::string					get_model_name() const;
	virtual t_screen_rect		get_rect() const;
	virtual t_screen_rect		get_rect( t_uint32 current_time ) const;
	virtual t_screen_rect		get_shadow_rect() const;
	virtual t_screen_rect		get_shadow_rect( t_uint32 current_time ) const;
	virtual int					get_subimage_count() const;
	virtual int					get_subimage_depth_offset( int subimage_num ) const;
	virtual t_screen_rect		get_subimage_rect( int subimage_num ) const;
	virtual t_screen_rect		get_subimage_rect(
									int			subimage_num,
									t_uint32	time ) const;
	virtual bool				hit_test(
									t_uint32				current_time,
									t_screen_point const &	point ) const;
	virtual bool				is_decorative() const;
	virtual bool				needs_redrawing(
									t_uint32	last_update_time,
									t_uint32	current_time ) const;
	void						set_model( std::string const & new_model_name );
	void						set_model( t_model_cache const& model_cache );
	virtual bool				subimage_animates( int subimage_num ) const;
	virtual bool				subimage_is_underlay( int subimage_num ) const;
	virtual bool				subimage_needs_redrawing(
									int			subimage_num,
									t_uint32	last_update_time,
									t_uint32	current_time ) const;

	// Operators
	t_abstract_stationary_adv_object & operator=( t_abstract_stationary_adv_object const & other );

protected:
	// Member functions
	void	set_flag_color( t_player_color new_flag_color );

private:
	// Types
	typedef abstract_stationary_adv_object_details::t_impl t_impl;
	friend class abstract_stationary_adv_object_details::t_impl;

	// Data members
	t_copy_on_write_ptr< t_impl >	m_impl_ptr;
};

#endif // !defined( ABSTRACT_STATIONARY_ADV_OBJECT_H_INCLUDED )
